package com.nbjtjc.safe.mapper.know;

import com.nbjtjc.safe.model.know.SafeLabel;
import com.nbjtjc.util.MyMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SafeLabelMapper extends MyMapper<SafeLabel> {

    @Delete("delete from safe_label where label=#{label}")
    int deleteByLabel(@Param("label") String label);

    List<SafeLabel> search(@Param("label") SafeLabel label);

    List<SafeLabel> getSonCount(@Param("label") SafeLabel label);

    @Select("select DISTINCT label  from safe_label where company_id=#{companyId}")
    List<String> findLabelStr(@Param("companyId") Integer companyId);
}